10th international ABINIT developer workshop
May 31 - June 4, 2021 - Smart Working, Lockdown

Use the Space key to navigate through all slides.

NB: AbiPy can be interfaced with other packages (e.g ASE, phonopy) via converters.
Using conda and the conda forge channel (recommended):
conda install abipy --channel conda-forge
Recipes for AbiPy and ABINIT are now supported by the conda-forge community thus:
Since conda is not limited to py packages, one can install ABINIT in the same env with:
conda install abinit -c conda-forge
Using pip and python wheels:
pip install abipy --user
From the github repository:
git clone https://github.com/abinit/abipy.git
cd abipy
python setup.py install # or `develop` for development
For further info see http://abinit.github.io/abipy/installation.html
%embed https://abinit.github.io/abipy/index.html
New Flows and improved post-processing tools for:
in addition to the standard workflows/tools for GS, DFPT, $GW$, IP optics, Bethe-Salpeter, etc.
NB: There's an ongoing effort to reimplement AbiFlows in terms of the atomate framework. In this talk will mainly discuss the new features available in abipy.flowtk.
(contributed by G. Petretto)
Can be used to:
Algorithm:
output_dir_path.In python, everything boils down to:
ddb = abilab.abiopen("mp-149_DDB")
ph = ddb.anaget_phonopy_ifc(output_dir_path="output_dir") # Phonopy object
* Example: obtain phonon irreps from DDB using phonopy
```python
ddb = abilab.abiopen("mp-149_DDB")
ph = ddb.anaget_phonopy_ifc(ngqpt=[1,1,1])
ph.set_irreps([0, 0, 0])
ph.get_irreps().show()
```
For the formalism, see:
scf_input = make_scf_input() # Build input for GS calculation
elast_work = flowtk.ElasticWork.from_scf_input(scf_input,
with_relaxed_ion=True,
with_piezo=True)

from abipy.abio.factories import gs_input
gs_input(structure="si.cif", pseudos="14si.pspnc", ecut=8)
multi = abilab.ebands_input(structure="si.cif",
pseudos="14si.pspnc",
ecut=8,
spin_mode="unpolarized",
smearing=None,
dos_kppa=5000)
multi.get_vars_dataframe("kptopt", "iscf", "ngkpt")
| kptopt | iscf | ngkpt | |
|---|---|---|---|
| dataset 0 | 1 | None | [8, 8, 8] |
| dataset 1 | -11 | -2 | None |
| dataset 2 | 1 | -2 | [14, 14, 14] |
scheduler.yml providing:
manager.yml providing:
See this page for examples or use the abidoc.py script:
The simplest way to start the scheduler from the shell is through the syntax:
run_elastic.py --scheduler # -s for the short option
For non-trivial Flows, we suggest the scheduler in background and use nohup
nohup run_elastic.py --s > log 2> err &
so that we can disconnect from the shell session without killing the scheduler.
elastic_ddb = abilab.abiopen("elastic_DDB")
edata = elastic_ddb.anaget_elastic()
# Pandas DataFrame with relaxed-atoms elastic tensor.
edata.elastic_relaxed
| xx | yy | zz | yz | xz | xy | |
|---|---|---|---|---|---|---|
| Voigt index | ||||||
| xx | 135.262182 | 54.450376 | 38.052927 | 0.00000 | 0.000000 | 0.000000 |
| yy | 54.450376 | 135.262181 | 38.052927 | 0.00000 | 0.000000 | 0.000000 |
| zz | 38.052927 | 38.052926 | 148.211029 | 0.00000 | 0.000000 | 0.000000 |
| yz | 0.000000 | 0.000000 | 0.000000 | 30.55071 | 0.000000 | 0.000000 |
| xz | 0.000000 | 0.000000 | 0.000000 | 0.00000 | 30.550709 | 0.000000 |
| xy | 0.000000 | 0.000000 | 0.000000 | 0.00000 | 0.000000 | 40.405903 |
edata.get_elastic_properties_dataframe(properties_as_index=True)
| property | 0 | 1 | |
|---|---|---|---|
| 0 | trans_v | 3.194459e+03 | 3.838052e+03 |
| 1 | long_v | 5.796035e+03 | 6.295200e+03 |
| 2 | snyder_ac | 5.767044e+01 | 8.693459e+01 |
| 3 | snyder_opt | 3.158141e-01 | 3.621134e-01 |
| 4 | snyder_total | 5.798626e+01 | 8.729670e+01 |
| 5 | clarke_thermalcond | 7.734051e-01 | 9.006348e-01 |
| 6 | cahill_thermalcond | 8.539415e-01 | 9.791319e-01 |
| 7 | debye_temperature | 3.760623e+02 | 4.477874e+02 |
| 8 | k_voigt | 7.553865e+01 | 7.553930e+01 |
| 9 | k_reuss | 7.553074e+01 | 7.553579e+01 |
| 10 | k_vrh | 7.553469e+01 | 7.553754e+01 |
| 11 | g_voigt | 3.951341e+01 | 5.767416e+01 |
| 12 | g_reuss | 3.761300e+01 | 5.366047e+01 |
| 13 | g_vrh | 3.856321e+01 | 5.566731e+01 |
| 14 | universal_anisotropy | 2.527308e-01 | 3.740360e-01 |
| 15 | homogeneous_poisson | 2.818554e-01 | 2.041909e-01 |
| 16 | y_mod | 9.886491e+10 | 1.340681e+11 |
This flow computes the Gruneisen parameters:
\begin{equation*} \newcommand{\PDER}[2]{\dfrac{\partial #1}{\partial #2}} \gamma_{\mathbf{q}\nu} = -\PDER{\ln \wqnu}{\ln V} = -\dfrac{V}{\wqnu}\,\PDER{\wqnu}{V} \end{equation*}where $D(\mathbf{q})\,{\epsilon_{\mathbf{q}\nu}} = \omega^2_s(\mathbf{q})\,\epsilon_{\mathbf{q}\nu}$ with $D$ the dynamical matrix.
The derivative wrt $V$ can be rewritten as:
\begin{equation*} \PDER{\omega^2(\mathbf{q}\nu)}{V} = 2\wqnu\,\PDER{\wqnu}{V} \langle \eqnu | \PDER{D(\qq)}{V} | \eqnu \rangle \end{equation*}where the r.h.s is computed by anaddb using finite differences of DFPT results.
scf_input = make_scf_input() # Build input for GS calculation
# NB: k-mesh in gs_inp and ngqpt q-mesh must be commensurate.
from abipy.flowtk.gruneisen import GruneisenWork
voldelta = gs_inp.structure.volume * 0.02
work = GruneisenWork.from_gs_input(gs_inp, voldelta, ngqpt=[2, 2, 2],
with_becs=False)

gruns = abiopen("out_GRUNS.nc")
gruns.plot_gruns_scatter();
abiopen.py out_GRUNS.nc --expose-web # -ew for the short version

(contributed by F. Naccarato)
For the formalism see:
scf_input = make_scf_input() # Get the SCF input (without SOC)
scf_input = make_scf_input()
return flowtk.NonLinearCoeffFlow.from_scf_input("nlo_flow", scf_input)
For the formalism see J. Laflamme Janssen, et. al. Phys. Rev. B 93, 205147
scf_input = make_scf_input() # Get the SCF input (without SOC)
from abipy.flowtk.effmass_works import EffMassAutoDFPTWork
flow = flowtk.Flow("effmass_flow")
work = EffMassAutoDFPTWork.from_scf_input(scf_input)
flow.register_work(work)

This example shows how to compute the e-ph matrix elements in AlAs along a q-path with AbiPy flows. The final results are stored in the GKQ.nc file (one file for q-point) in the outdata of each task.
# Build input for GS calculation on a 2x2x2 k-mesh
scf_input = make_scf_input(ngkpt=(2, 2, 2))
# q-mesh for phonons
ngqpt = (2, 2, 2)
# Create flow to compute all the independent atomic perturbations
# Use ndivsm = 0 to pass an explicit list of q-points.
# If ndivsm > 0, qpath_list is interpreted as a list of boundaries for the q-path
qpath_list = [[0.0, 0.0, 0.0], [0.01, 0, 0], [0.1, 0, 0],
[0.24, 0, 0], [0.3, 0, 0], [0.45, 0, 0], [0.5, 0.0, 0.0]]
from abipy.flowtk.eph_flows import GkqPathFlow
flow = GkqPathFlow.from_scf_input("flow_dir", scf_input,
ngqpt, qpath_list, ndivsm=0, with_becs=True,
ddk_tolerance={"tolwfr": 1e-8})
Formalism:
https://abinit.github.io/abipy/flow_gallery/run_gkq.html#sphx-glr-flow-gallery-run-gkq-py


Several other plotting libraries are available in the pydata ecosystem
gsr = abiopen("si_nscf_GSR.nc")
gsr.ebands.plot(with_gaps=True);
(contributed by Y. He and MG)
gsr.ebands.plotly(with_gaps=True); # object.plot becomes object.plotly
gsr.ebands.plotly(with_gaps=True, chart_studio=True);

gsr.ebands.kpoints.plotly(title="k-path in 3d with plotly");
gsr.ebands.kpoints.plot(title="Static matplotlib figure");


ddb = abilab.abiopen("ZnSe_hex_qpt_DDB")
abilab.abipanel(); # Important
ddb.get_panel()
ddb.structure.get_panel()
get_panel inside a notebook is great as you have GUIs and at the same time you can execute python code. --panel option:¶abiopen.py out_DDB --panel # or -pn if you preder the short option.

abiopen.py mgb2_kpath_FATBANDS.nc --expose --seaborn
abiopen.py mgb2_kpath_FATBANDS.nc --expose-web # -ewb
abiopen.py mgb2_kpath_FATBANDS.nc --plotly # -ply

to get a quick look at the results
abiview.py ddb ZnSe_hex_qpt_DDB --panel # or -pn if you prefer the short version.
abiview.py ddb ZnSe_hex_qpt_DDB --plotly # -ply

%embed https://abinit.github.io/abipy/graphical_interface.html
Use AbiPy programmatic interface to implement: